package com.jy.adscm.zltx.mapper.mysql;

import com.jy.adscm.zltx.bean.JyDrawingEditInfo;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 图纸修订记录 Mapper 接口
 * </p>
 *
 * @author zyl
 * @since 2018-10-26
 */
public interface JyDrawingEditInfoMapper extends BaseMapper<JyDrawingEditInfo> {

    /**
     * 通过id，查询这个修改记录对应的图纸信息的相关的所有修改记录
     * @param id
     * @return
     */
    @Select("SELECT id,drawing_id drawingId,modify_content modifyContent,modifier,modify_time modifyTime,modify_reason modifyReason,approval_person approvalPerson," +
            "approval_time approvalTime,approval_result approvalResult,approval_remark approvalRemark,modified_drawing_path modifiedDrawingPath," +
            "drawing_name drawingName,drawing_code drawingCode,drawing_version drawingVersion," +
            "drawing_price drawingPrice,technics_remark technicsRemark,drawing_remark drawingRemark " +
            "FROM " +
                "jy_drawing_edit_info " +
            "WHERE " +
               "drawing_id = (SELECT drawing_id FROM jy_drawing_edit_info WHERE ID = #{id}) ORDER BY modify_time")
    List<JyDrawingEditInfo> getDrawingEditList(Long id);
}
